#ifndef COLUMNLIST_H
#define COLUMNLIST_H

#include <vector>
#include <string>

// forward declarations.
class Column;

using namespace std;

/*
    Class: ColumnList
    Represents a list of columns for SQL views.
*/
class ColumnList
{
    /* Section: public */
    public:
        /*
            Destructor: Default destructor.
            Destroy the object.
        */
        virtual ~ColumnList();

        /*
            Constructor: Copy constructor.
            Initializes the object as a copy of other ColumnList object.

            Parameters:
                other - ColumnList object to copy from.
        */
        ColumnList(const ColumnList& other);

        /*
            Contructor: Parametrized constructor.
            Initializes the object with the given parameters.

            Parameters:
                columns - vector of Columns of the ColumnList.
        */
        ColumnList(vector<Column *> * columns = NULL);

        /*
            Method: getColumns
            Returns:
                A const pointer to the vector of columns of the object

            See also:
                Column
        */
        vector<Column *> * getColumns() ;//const;

        /*
            Method: addColumn
            Adds a new column to the ColumList as a clone of the Column given.

            Parameters:
                column - Column to add.

            See also:
                Column
        */
        void addColumn(Column * column);

        /*
            Method: addColumn
            Adds a new column to the ColumList.

            Parameters:
                column - Name of the column to add.
        */
        void addColumn(const string & column);

        /*
            Method: setColumns
            Sets the columns of the ColumnList. Delete the previous if any.

            Parameters:
                columns - vector of Columns
        */
        void setColumns(vector<Column *> * columns);

        /*
            Method: size
            Returns:
                Number of columns of the ColumnList.
        */
        virtual int size();

        /*
            Method: toString
            Returns:
                A string representation of the column list.
        */
        string toString();

        /*
            Method: clone
            Returns:
                A clone of this object.
        */
        ColumnList * clone();

    /* Section: private */
    private:
        /*
            Variable: columns
            Type: vector<Column *> *
            List of columns.

            See also:
                Column
        */
        vector<Column *> * columns;
};

#endif // COLUMNLIST_H
